package com.lpy.job;

import com.lpy.service.StockTimerTaskService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author lpy
 * @date 2025/2/18
 * @Description
 */
@Component
public class StockJob {
    @XxlJob("lpy_job_test")
    public void jobTest(){
        System.out.println("jobTest run.....");
    }
    /**
     * 注入股票定时任务服务bean
     */
    @Autowired
    private StockTimerTaskService stockTimerTaskService;


    /**
     * 定义定时任务，采集国内大盘数据
     */
    @XxlJob("getStockInnerMarketInfos")
    public void getStockInnerMarketInfos(){
        stockTimerTaskService.getInnerMarketInfo();
    }

    /**
     * 定义定时任务，采集国内个股数据
     */
    @XxlJob("getStockRtIndex")
    public void getStockRtIndex(){
        stockTimerTaskService.getStockRtIndex();
    }

    /**
     * 定义定时任务，采集国内板块数据
     */
    @XxlJob("getStockBlockRtInfo")
    public void getStockBlockRtInfo(){
        stockTimerTaskService.getStockBlockRtInfo();
    }

    @XxlJob("getOuterMarketInfo")
    public void getOuterMarketInfo(){
        stockTimerTaskService.getOuterMarketInfo();
    }

}
